﻿using System;
using System.Collections.Generic;
using System.Data.Common;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PersistenciaImplementacion
{
    public class Conexion
    {
        private static Conexion instancia;
        private static string connectionString = "Data Source=NOTEBOOK\\SQLEXPRESS;Initial Catalog=PersistenciaObligatorio;Persist Security Info=True;User ID=sa;Password=12345";
        private SqlConnection conn;

        private Conexion() {
            conn = new SqlConnection(connectionString);
        }

        public SqlConnection ConectarBase()
        {
            return conn;
        }

        public static Conexion GetInstance()
        {
            if (instancia == null)
            {
                instancia = new Conexion();
                
            }
            return instancia;
        }
    }
}
